package com.atguigu.mock.entity;

import com.atguigu.common.base.entity.AutoIdBase;
import com.atguigu.common.comment.Comment;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import javax.persistence.Entity;
import javax.persistence.OneToOne;
import java.time.LocalDateTime;

@Entity
@Getter
@Setter
@NoArgsConstructor
@Comment("合同表")
public class Contract extends AutoIdBase {

    @Comment("关联的业务授信")
    @OneToOne(optional = false)
    private Credit credit;

    @Comment("合同状态：1.新建 2.已签约 3.已起租")
    private int status;

    @Comment("签约时间")
    private LocalDateTime signedTime;

    @Comment("起租时间")
    private LocalDateTime executionTime;

    public Contract(LocalDateTime createTime, Credit credit) {
        super(createTime);
        this.credit = credit;
    }
}
